//
//  DetailVideoCell.m
//  TrainTree
//
//  Created by wanghui on 2017/9/14.
//  Copyright © 2017年 YouYeShu. All rights reserved.
//

#import "DetailVideoCell.h"

@implementation DetailVideoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.bluePoint.layer.cornerRadius = 8.0f;
    self.bluePoint.layer.borderColor = verticalColor.CGColor;
    self.bluePoint.layer.borderWidth = 2.0f;
    self.bluePoint.layer.masksToBounds = YES;

    self.insidePoint.layer.cornerRadius = 4.0f;
    self.insidePoint.backgroundColor = verticalColor;
    self.insidePoint.layer.masksToBounds = YES;

    self.topLine.backgroundColor = verticalColor;
    self.bottomLine.backgroundColor = verticalColor;
}
#pragma  mark - 只有一条不显示左侧竖线
- (void)configWithOnlyOne
{
    self.topLine.hidden = YES;
    self.insidePoint.hidden = YES;
    self.bottomLine.hidden = YES;
    self.bluePoint.hidden = YES;
}
#pragma  mark - 第一条
- (void)configWithFirstModel:(PointModel *)model
{
    self.topLine.hidden = YES;
    self.title.text = model.pointName;
    [self.icon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",TrainTreeFileImgURL,model.pointCover]] placeholderImage:ImageNamed(@"ty_pic")];
    self.time.text = [TimeTool convertTimeFromSeconds:model.pointVideoTime];
    if ([model.studyStatus intValue] == 0) {
            // 0未学
        self.bottomLine.backgroundColor = verticalGrayColor;
        self.insidePoint.hidden = YES;
        self.bluePoint.layer.borderColor = verticalGrayColor.CGColor;
    } else {
        self.bottomLine.backgroundColor = verticalColor;
        self.insidePoint.hidden = NO;
        self.bluePoint.layer.borderColor = verticalColor.CGColor;
    }
}
#pragma  mark - 最后一条
- (void)configWithLastModel:(PointModel *)model
{
    self.bottomLine.hidden = YES;
    self.title.text = model.pointName;
    [self.icon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",TrainTreeFileImgURL,model.pointCover]] placeholderImage:ImageNamed(@"bear.jpg")];

    self.time.text = [TimeTool convertTimeFromSeconds:model.pointVideoTime];
    if ([model.studyStatus intValue] == 0) {
            // 0未学
        self.topLine.backgroundColor = verticalGrayColor;
        self.insidePoint.hidden = YES;
        self.bluePoint.layer.borderColor = verticalGrayColor.CGColor;
    } else {
        self.topLine.backgroundColor = verticalColor;
        self.insidePoint.hidden = NO;
        self.bluePoint.layer.borderColor = verticalColor.CGColor;
    }
}

- (void)configWithModel:(PointModel *)model
{
    self.title.text = model.pointName;
    [self.icon sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",TrainTreeFileImgURL,model.pointCover]] placeholderImage:ImageNamed(@"ty_pic")];

    self.time.text = [TimeTool convertTimeFromSeconds:model.pointVideoTime];
    if ([model.studyStatus intValue] == 0) {
         // 0未学
        self.topLine.backgroundColor = verticalGrayColor;
        self.bottomLine.backgroundColor = verticalGrayColor;
        self.insidePoint.hidden = YES;
        self.bluePoint.layer.borderColor = verticalGrayColor.CGColor;
    } else {
        self.topLine.backgroundColor = verticalColor;
        self.bottomLine.backgroundColor = verticalColor;
        self.insidePoint.hidden = NO;
        self.bluePoint.layer.borderColor = verticalColor.CGColor;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
